<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Toast组件</title>
    <link rel="stylesheet" href="../src/sea-ui.css">
</head>

<body>
    <div class="sea-content">
        <h1 class="sea-panel-title">Toast提示组件</h1>
        <div class="sea-panel-body">
            <a class="sea-btn sea-btn-primary" href="javascript:showToastLoading()">加载中提示</a>
            <br>
            <a class="sea-btn sea-btn-primary" href="javascript:showToastSuccess()">成功提示</a>
        </div>
    </div>
    <div class="sea-toast" id="toast-loading">
        <i class="fa fa-spinner fa-pulse sea-toast-icon"></i>
        <p class="sea-toast-info">加载中</p>
    </div>
    <div class="sea-toast" id="toast-success">
        <i class="fa fa-check sea-toast-icon"></i>
        <p class="sea-toast-info">操作成功</p>
    </div>
    <script>
        function showToastLoading(){
            var toastEle = document.getElementById('toast-loading')
            toastEle.classList.add('show')
            setTimeout(function(){
                toastEle.classList.remove('show')
            }, 2000)
        }

        function showToastSuccess(){
            var toastEle = document.getElementById('toast-success')
            toastEle.classList.add('show')
            setTimeout(function(){
                toastEle.classList.remove('show')
            }, 2000)
        }

    </script>
</body>

</html>